bitkeeper revision 1.22.1.6 (3e3fe07f2qF_tQ4Ixhocx0G38HxwOg)
authorkaf24@labyrinth.cl.cam.ac.uk <kaf24@labyrinth.cl.cam.ac.uk>
Tue, 4 Feb 2003 15:47:11 +0000 (15:47 +0000)
committerkaf24@labyrinth.cl.cam.ac.uk <kaf24@labyrinth.cl.cam.ac.uk>
Tue, 4 Feb 2003 15:47:11 +0000 (15:47 +0000)
domain.c:
  We now properly deallocate domain memory during teardown.

xen-2.4.16/common/domain.c

index bfa15ef4a427ec3517bb19b1f6a6e12586383b1a..3a0222c7d6c4f03f0e51cf9e1dfcc7c56aae3623 100644 (file)
@@ -263,6 +263,17 @@ void release_task(struct task_struct *p)
     }
     if ( p->mm.perdomain_pt ) free_page((unsigned long)p->mm.perdomain_pt);
     free_page((unsigned long)p->shared_info);
+    if ( p->tot_pages != 0 )
+    {
+        /* Splice domain's pages into the free list. */
+        struct list_head *first = &frame_table[p->pg_head].list;
+        struct list_head *last  = first->prev;
+        free_list.next->prev = last;
+        last->next = free_list.next;
+        free_list.next = first;
+        first->prev = &free_list;            
+        free_pfns += p->tot_pages;
+    }
     free_task_struct(p);
 }